package com.baichang.taoshunda.controller;

import com.baichang.framework.controller.IPageController;
import com.baichang.framework.controller.WebBaseController;
import com.baichang.framework.excelption.ServiceException;
import com.baichang.framework.model.Page;
import com.baichang.taoshunda.ControllerConstants;
import com.baichang.taoshunda.service.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Administrator on 2017/10/30 0030.
 */
@Controller
@RequestMapping(ControllerConstants.OPINION)
public class OpinionBackWController extends WebBaseController {

    @Autowired
    private FeedBackService feedBackService;

    /**
     * 跳转意见反馈页面
     *
     * @return
     */
    @RequestMapping("/findOpinionIndex")
    public String findIndex() {
        return "/taoshunda/feed/info";
    }

    /**
     * 意见反馈查询
     *
     * @param request
     * @param response
     */
    @RequestMapping("/queryOpinion")
    public void queryOpinion(final HttpServletRequest request, HttpServletResponse response) {
        initPage(request, response, new IPageController() {
            @Override
            public Page initPage(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServiceException {
                String checkUserName = getString(httpServletRequest, "checkUserName","");
                return feedBackService.queryOpinion(nowPage, pageSize,checkUserName);
            }
        });
    }
}
